<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title><%=title%></title>
    <link rel="stylesheet" href="/bootstrap/dist/css/bootstrap.css">
    <style>
        img{
            width:30px;
            height:30px;
            border-radius: 50%;
        }
    </style>
</head>
<body>
<nav class="navbar navbar-inverse">
    <div class="container-fluid">
        <div class="navbar-header">
            <a href="" class="navbar-brand"> 珠峰博客</a>
        </div>
        <div>
            <ul class="nav navbar-nav">
                <li><a href="/">首页</a></li>
                <%if(user){%>
                <li><a href="/user/signout">退出</a></li>
                <li><a href="/article/add">发表文章</a></li>
                <%}else{%>
                <li><a href="/user/signup">注册</a></li>
                <li><a href="/user/signin">登录</a></li>
                <%}%>
            </ul>
            <form action="/" role="search" class="navbar-form navbar-left">
                <div class="form-group">
                    <input type="text" class="form-control" value="<%=keyword%>" name="keyword" placeholder="请输入关键字">
                </div>
                <button type="submit" class="btn btn-default">搜索</button>
            </form>
            <%if(user){%>
            <ul class="nav navbar-nav navbar-right">
                <li>
                    <a href="#">
                        <img src="<%=user.avatar%>" alt="">
                        <%=user.username%>
                    </a>
                </li>
            </ul>
            <%}%>
        </div>
    </div>
</nav>
<div class="container">
    <%if(success){%>
    <div class="alert alert-success"><%=success%></div>
    <%}%>
    <%if(error){%>
    <div class="alert alert-danger"><%=error%></div>
    <%}%>